<template>
    <div class="itembook" >
        <div class="top">
            <h2>{{itemObj.title}}</h2>
            <div class="time">{{ getMyDate(itemObj.posttime,1) }}</div>
        </div>
        <div class="center">
            {{ itemObj.content }}
        </div>
        <div class="info">
            <div class="list">
                所属分类
                <span>{{itemObj.classify }}</span>
            </div>
            <div class="author">
                作者：
                <span>{{ itemObj.author }}</span>
            </div>
        </div>
    </div>
</template>
<script>
import common from '@/assets/js/common';
// console.log(common.myDate("2604970906",1));
export default {
    // props:["myTitle","myContent"]
    props:{
        // myTitle:{
        //     type:String,
        //     default:""
        // },
        // myContent:{
        //     type:String,
        //     default:""
        // },
        itemObj:{
            type:Object,
            default:function() {
                return {}
            }
        }
    },
    methods: {
        getMyDate(time,type){
            return common.myDate(time,type);
        },
    },
}
</script>

<style lang="less" scoped>
.itembook{
    padding: 30px 0;
    .top{
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding-bottom: 10px;
        word-wrap: break-word;
        white-space: normal;
        word-break: break-all;
        h2{
            font-size: 25px;
            color: #333;
            width: 750px;
        }
        .time{
            font-size: 14px;
            color: #888;
        }

    }
}
.center{
    background: #f6f6f6;
    border-radius: 5px;
    padding: 15px;
    font-size: 18px;
    line-height: 1.8em;
    color: #444;
    margin-bottom: 10px;
    // 以下三行处理纯字母数字自动换行
    word-wrap: break-word;
    white-space: normal;
    word-break: break-all;
}

.info{
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #888;
    span{
      font-size: 16px;
      color: #666;  
    }
}
</style>